Updated unit tests
Reimplemented main as a class.