Change agent and order ID creation from using system time to using a
counter; fix logging of market orders