Refactor Kernel#singleton_class

Removed dead branches, removed duplication.