Refactor our command line ls-tree tool to use FileMode's type knowledge