Added ErrorHandler

Added *.h/*.c for ErrorHandling.
Implemented simple logging method.