Add mechanism that allows module and external code to register custom order number generators - TRUNK-4270

Follow up

Follow up
Updated tests that randomly fail when getting active orders after a revision to wait for a milli second