Commented code

The code is (still) in need of internal documentation, so comments have
been added. Still need to do a bunch of doc-strings as well .... later.