Merge pull request #38 from akitada/trader-leaks

trader: Fix memory leaks
Add missing command frame handling