add some unit tests
misc clean up and comment
fix several bugs with multiple missions on one day