Rough JavaScript conversion

More of a placeholder. This will likely need a lot of work.