Added method and test for moveToBefore.