Improved base code of pdfminer.

- Fixed all PEP8 errors
- Moved most tests to folder "tests" (discoverable by unittest)
- Added some docstrings
- Removed redundant `return`s
- Removed redundant comments
- Removed reduntant parenteses