Added code docs, now using docstrings. Fixed a few syntax errors. Removed trailing whitespace.

Change-Id: I0658eb7a5fdd8f873b5dc052a8332cdee3aa4417
Merge "Added code docs, now using docstrings. Fixed a few syntax errors. Removed trailing whitespace."