PEP8ify the code, add docstrings and minor refactoring

Loads of changes with this commit. Mostly stick to PEP8
conventions for Python code. The changes made include:
* Limit line length to 79 characters
* Add module docstring
* Add class docstring
* Add function docstrings
* Ensure no erroneous whitespaces
* Move methods which are not related to the module out of the
class
* Use new style class declaration
* Use PEP8 style function naming
* _create_conf_file does not need the CONF_PATH parameter
* _read_conf_file accepts a normal parameter, not a global const
* check_code is declared in a class but did not take self as a
parameter. Fixed this.

One of the conventions being followed in splitting long lines is:
For function calls, if the line is too long, break the line with
no parameters after the opening bracket, one one indentation level
and split line every time the length is exceeded.