New model pull request for code review

I see lots of shared code between this file and `orbit_main.js`. Not sure if they're both used or one is a legacy file that is no longer used.

If they're both still in use, there's definitely a lot of shared code between the two, which could be abstracted out into a separate file they share.