Made tests more readable.
Some refactoring.
Added some new tests.