JS Code Hints Crash Preventer

1. Update Tern
2. Implement timeout

cc @dangoor 

This is the `try` block that catches the exception, but I added the others to be safe.