Formats cleanup

Move the various data encoding formats into a "formats/" directory. Also, get rid of "format.cpp", whose name would now be confusing given the new folder name. Also, overload decode_base58 to work like the other format decoders.