Started working on testsuite, slowly removing chai()-asserts from production code, introduced custom errors