Separated main interfaces' JS to new file

Forgot that was all sitting inline