restructuring the code

- exception handling
- allow continuing after failure
- better doc
- better sanity checks
- verbose flag
- pep8 cleanup
- pychecker cleanup