Assorted clean up.

Better organized the import statements and added basic logging.