Started writing unit tests, need to refactor to enable importing as module