Improve error handling

hooks/lines.py:
Add a docsting to `checkfile' procedure.

hooks/pre-commit:
Surround checks that try to open files by try-except statements to guarentee
cleanup if an error occures during execution.
Improve formatting of pre-commit script
Modularize pre-commit hook

/hooks/pre-commit:
- put format checking into new procedure