Full test suite, bugfixes, documentation