Put callbacks for create_view and create_child_view in options

And add errback support
Clean up some JS code