Break up big one-file implementation into more standard gem structure