Added basic prototype, fixed some gem stuff, cleanup.