Use Python logging for error reporting. Cleanup code. Automate some static analysis.

This sequence of commits addresses issues #1, #3 and #4.

The `error.py` module is refactored; bookkeeping is outsourced to the Python `logging` module. Appropriate changes are made across other modules to use the new interface.
Also included:
1) `Makefile` targets for static analysis using `pylint` and `pep8`.
2) Cleanup of unused code in `lexer.py`
3) Some code grooming.
These changes are nice and convey the semantics better :+1: