Refactors tests and adds functionality from exercises.