Gem init.
Initial stuff, cleaning up some code structure.