Port utils and models to JS