Detect undefined properties and identifiers, and invalid function calls.

Fixes angelozerr/tern.lint#1.
Fixes angelozerr/tern.lint#2.
Some cleanup and comments.
Merge pull request #3 from journeyapps/master

Detect undefined properties and identifiers, and invalid function calls