Porting over rails' implementation of underscore

This certainly needs to be moved out into a helper and at least a few tests written