Adds lib directory back and moves transform code from spec helper here.