first round of unittest coverage. 100% right now but could be better tests. fixes #24