Code cleanup to be more conforming to style guide.

- Returning `Unit` instad of using procedure syntax.
- Explicitly listing return type for `def`s.
- Adding/removing () for arity-0 methods depending on whether they have side-effects.
- Removing unused imports.
- Fixed missing "`" in doc strings.