improved list command
significant restructuring of commands and code; various bug fixes