Refactor the auto trip plan generator script to have a reusable base class.