Fix old ruby

Made multiple changes that are required for compatibility with ruby 1.9.3. 
#79 should be fixed by this
Is this line really needed?   "application_error_code" (the attr_reader defined var) would be nil at this point in the initialization.   so this line seems to do nothing.