I've done a bunch of work all over the place. Some more ruby solutions for the people too.
Merged in master.