Playing around in order to make scopes prettier..
Some progress.
Works. Needs cleaning up though. (And new issue: to_string doesn't work?)
Tried to put the js in a separate file.. Doesn't work for mysterious
reasons. Leaving it for the moment.
Added a little comment.