Unit tests

Added tests for core functionality. 7 of 7 tests passed.