Extract trail functionality

Will be available in the gretel-trails gem.