Updates to javascript snippets
Add misc vim javascript helper functions