Add main logic to project, add simple unit tests