[WIP] Refactor toMap

I propose refactoring `toMap` and `toMultimap` to be more Scala idiomatic. This PR is my initial idea about `toMap`.

Any thoughts?

/cc @samuelgruetter @headinthebox
will need more tests with assertions, and one def per test