Fixed up library and test suite to a "working" state