Use Foldable instead of list where applicable

This allows different ways of constructing list-like things
(e.g. series of SequenceCommands) whilst still using them with a
command which expects a list as argument.
Add some strictness annotations
Implement 'statistics' call