Cleanup Robot class

Fix style issues and refactor code into shorter, more logical methods. Remove
use of class variable. Move custom exceptions into Robot class.