added 'info' command, and misc refactoring