Add methods to convert to/from base36. Fix #265.