fix and speedup orderbook trades, js fixes