docstrings now better formatted for Sphinx, added more comments, minor refactoring of utility methods, improving readablity at the expense of line numbers