cleanups of the code (no functional changes)

There are no functional changes here, this is just a bit of a purge e.g.
* Removing unnecessary braces
* Cleaning up imports
* Removing unnecessary blocks
* Removing unnecessary semi-colons
* Enabling unchecked warning reporting and cleaning them up.

Once #445 is fixed I will port this to the master branch)