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.
We never used it, and the parser also won't. This was there for completeness of interface, but it is not needed; it hasn't even been tested.