Fix mock transaction sorting

Sorting by timestamp wasn't sufficient because transactions could have
the same timestamp. Added an additional data structure which consist of
transaction IDs ordered by creation time. Also implemented the same
thing for transfers and orders.