Optimizations, bugfixes, more tests, updated README