Add tests and finish UML