Work in progress commit: some code cleanups along with appledoc annotations inserted for documentation purposes.