store rides on different patterns separately, using indexes

this allows for routes that contain the same stop twice
Merge branch '1320_patterns' into arlington