Added JavaScript view support

I hope the merge I did doesn't make this pull request too messy. If so, let me know and I'll send you the patch a different way.