Encodes maps into object
updated to otp 17 for elixir v0.13