Refactoring, tests, typescript, readme.