Closes #23 - almost all tests written