Port base models to JavaScript

Signed-off-by: Byron Ruth <b@devel.io>