first attempt at error codes and reslience
raise exception if failed
menthod for successful initialization
clean up debug statements
Merge pull request #1 from menpo/errorcodes

Basic error handling