another round of bugfixes, added more under tests dir, updates README