Log formatter

Fixes #3

Let me know anyway I can improve! I still feel like I'm learning 'the functional way' so any feedback is appreciated.


I forget exactly what I said and can't find it in the outdated diffs. I think the gist of it was that map + join is doing 4 traversals[1] of the list and does unnecessary binary reallocation. I was more thinking about speed than memory.

I gave an example that maintained order but since this is not required perhaps this example is clearer:
```elixir
defp output(:metadata, _, _, _, []), do: []
defp output(:metadata, _, _, _, meta) do
  [?\s | rest] = Enum.reduce(meta, [], fn({key, val}, acc) -> [?\s, to_string(key), ?=, to_string(val) | acc] end)
  rest
end
```
This is 1 traversal with zero copy concatenation. Of course a variation of [1] could be used to only do 1 traversal, however it would be more verbose (and less obvious) and still requires copying when appending binaries[2]. Note that reallocating the binaries creates garbage, which will need to be collected.

I am unsure if it is less obvious because you are unfamiliar with `iodata`/`chardata` or because it actually is less obvious.  A more complex example using `chardata` is `Dbg` [3], would using string interpolation make it more obvious? I don't think so but clarity is often a matter of opinion.

I am not meaning to give you a hard time and am not picking on you or this piece of code. One could certainly argue that I am suggesting a premature optimisation and maybe that is obfuscating the code. I am more trying to raise a point to you (or anyone in the binary favouring/string interpolation loving elixir community that happens to read this) that `iodata`/`chardata` has some nice benefits and should be just as natural.

I am now going to rant because it is a big pet peeve of mine in open source Elixir projects. When writing a library it is important to consider `iodata`. For example if there was a JSON library that has a protocol/option for encoding structs, if the library forces you to return a `binary` (or an elixir term that it will then encode), and not `iodata`, the library is not allowing you to be efficient and you should probably look at using a different library that likely has a better implementation. I don't want to have to call `IO.iodata_to_binary/1`. One can easily merge JSON using `iodata`:
```elixir
[?{,
"\"key1\":  ", json1, ?,,
"\"key2\":  ", json2,
?}]
``` 
Notice it doesn't matter if `json1` and `json2` are `binary` or `iodata`.

I might want to take that encoded JSON `iodata` and send it to a websocket using a web framework. If the web framework's send function only accepts binaries (or elixir terms that it will then encode) it is forcing one workflow and getting in the way.

[1] `Enum.join/2` could be special cased for lists to do 1 traversal, which I would guess is faster than current approach?

```elixir
def join([], _joiner), do: <<>>
def join([elem | rest], joiner) do: join_list(rest, joiner, to_string(elem))

defp join_list([elem | rest], joiner, acc) do
  join_list(rest, joiner, acc <> joiner <> to_string(elem))
end

defp join_list([], _joiner, acc), do: acc
```
[2] http://www.erlang.org/doc/efficiency_guide/binaryhandling.html
[3] https://github.com/fishcakez/dbg/blob/e8428ada8803317be3f295bddb5881a5dec4dfd8/lib/dbg/handler.ex