Fixed various minor Bugs. Added train.nextX, .nextY and .dir to some functions in the ai API