Encode MAM message ids in Base 32

While Base 36 is slightly shorter, Base 32 is easy to read
Fix a bug in elem_to_end_microseconds/1