Fix places using undefined variables

Also enable jshint option "undefined" in order to catch these kind
of errors in the future.
Merge pull request #648 from strongloop/fix/missing-loopback-var

Fix places using undefined variables