Add a proper bin/tern

Having to symlink desktop.js as tern is not very intuitive.
Add auto-shutdown behavior to the desktop server
Fix problem with reading tern-project-dir before setting it
[Emacs mode] Add support for sending partial files
[Emacs mode] Clean up interface to tern-run-request