Project restructuring. Added tests.