Updating code style, whitespace fixes, docblock tidying