Better exception handling

Stack trace pretty-printing has been moved to the utils.rb source file;
various modules and classes have been updated to better handle
exceptions and print their stack traces when an error is encountered.