Greatly improve error reporting.

Introduce logging facility to improve error reporting. Remove some now
unnecessary error enums. Users can set logging callback function using
efp_set_error_log.