Closes #5: Implemented dynamic boundary conditions for the energy range in the optimal ensemble sampling.

If one allready has the right energy boundaries, the new code is slightly slower than the old one, because additional checks have to be performed.