Use :lists.flatten

See: https://github.com/elixir-lang/elixir/issues/948
Use a list comprehension instead of Enum.map
Raise an ArgumentError instead of :erlang.error when :incomplete
This isn't needed
Encoding a nil is more common
Formatting & whitespace