added list records command

also fixed memory leaks and cleaned up some "unrecognized command" bugs