Added example custom application.
Made MySQL errors return exceptions.