Implementing the protocol outline in 31d77be.
Still needs some work. Not sure if we need the lookup table — it might be easiest to just stuff everything into the cleaned_trails table, because we aren’t too worried about normalizing data.