Moved the error and result types to it's own module.