several improvements and new functions

Moved code for getting end nodes to its own function
Made function which determines whether a way is suitable for a bus
Attempted to write a function which can extend a way and turn it into a
full edge, i.e. a sequence of non branching suitable ways.
Added global dictionary objects, so determining which ways belong to
which bus stops only needs to be done once.
Attempted to create a function which uses other route relations to get
from a way to the (way next to the) next stop on the route
Added function which takes one new and one existing relation and
replaces the sequence of stops  and tags