Few changes for performance and code clean up

TernWorker.js has been redone.  TernManager.js has been converted to a
function rather than a plain object.  Added a test for requirejs modules
that return a function and tern does not recognize that.