fix conditions in test
move union type definition above test, which makes implicits work
fill in README