Add script for managing tertiary refs and route relations