First Unit Tests + a bits of refactoring.

Test project was added and a first test written.