some tidying up
start writing tests
more tests
loads more tests for the daemon