Rails 4.0 compatibility fix.
Rails 4/Ruby 2.0 tweaks.
Use 2 spaces instead of a tab for indenting.
Rework dependend constant traversal.

Split the algorithm into 2 phases, first discover all related/dependend constants, then remove them in nesting order (removing the deepest nested first). This way a bug where a const might have been unset before all its nested modules/classes could have been traversed (and checked for their dependencies).
Don't use remove_possible_method.

ActiveSupports' remove_possible_method does undef_method, whereas what we need is Module#remove_method.
Improve load error checks.
Merge remote-tracking branch 'refs/remotes/local/mark-then-sweep-rework'