Lots of bugfixes, completed testsuite. First functional state. Still missing documentation.