Better exception handling and _.derived problem when accessed from constructors.

- Now throwing exceptions will log its message and the entire stack
trace to the console. This can be accessible by calling the toString
override of any Exception or derived Exception class.

- _.derived reference in constructors was not pointing to the right
object. This is fixed.