Merge pull request #94 from LinuxJedi/error_functions

Make error handling a hidden struct
Make errors in functions more consistent

THIS IS AN INCOMPATIBLE CHANGE