Support loading models from a js object