Remove trailing whitespace

Some files in the project had trailing whitespace. It was ugly and
thus removed.
Fix import order

Imports were somewhat unordered. Now imports are almost always
sorted into three groups (scala/java packages, third party packages and
first party packages) with fully qualified package names.