Refactors to Base64 and Payload modules.
Abstracts default image format.
Public functions at the top.