fix pep8 warning and move major util code from bin to compass dir.

Change-Id: I7baa536888db1ca46cadcdf07ef9cc0a1a3a12fb