Implement all remaining commands besides dump. Required some interface changes. Include tests