[IR] More tweaks + documentation of rubyclass determination algo.

* This is more accurate now and passes additional local tests
  that are not present in rubyspecs or mri tests.

* Added a FIXME about a possible unhandled edge case.

* Some more documentation.