Added a typedef for errors.
Made LavError and LAV_ERRORS; functions now return them and use out parameters.