Fix issues 57, 56, 48 and 39.

Binary encodes of floating point values are wrong in the code base
since they are encoded as lists. This makes the code crash. The mentioned
issues/pull requests assumes that io_lib is going to return a certain structure
however, but the only knowledge we have is that it will return an iolist().

While here, provide a test case for this kind of problem to ensure it does not
re-occur.