[DO NOT MERGE] Initial commit of refactor. Still contains old code.

This function and the related functions above it can probably go away; that is at least true for orignator.rb now so I am guessing also true here.