Finished/Started more of the JS functions, including tests. Will continue later.