Erlang term decoder/encoder

Encode Scala types into erlang and vice versa as closely as we can.