Earlier extras() can only be used for getting extra for a file. However at
couple of places in code, we wanted to iterate over all the extras stored with
the mergestate and they were accessing the private _stateextras.
Now, if filename is not passed, we return all the extras.