significant bug fixes, tests and some refactoring. sanskrit99 conversion is broken though