switch type-checker to set type instead of header

probably not as correct as it should be, but for now it passes the
tests.
add initial unit tests

closes #2