Clean up implementation, add documentation, add i18n