Code comments added, and changed the way of the error and exception handler registration. Fixes #3