[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
`scala.collection.immutable.TreeMap` ---> `immutable.TreeMap`