Split ls command

Fixes #71. Went with the design described there. Tried not to make any unnecessary changes in the implementation for now.