Official gems

Rewrite to use the official gems and make this whole thing much smaller.