Finished basic functionality.
Adding unit tests.