Better unit tests

Just more testing and a few extra switch entries here, no serious library changes, so if moosebuild likes this too then I'm just going to merge right away.