Inclued tests and some refactoration.
Student tests added.