Add list monad

Same semantics as Haskell.

Also a small fix to avoid warnings when running tests.