Exit with return value of main()
Split out error code into exceptions.py

Add an exceptions namespace for error-related stuff.