Refactoring, tests and multilanguage readme