core: Move hashing utilities to hash.hpp
core: Add formatting utilities

For now this is just string and exception formatter
gfx: Improve Image loading

Better error messages, pick format based on the image header instead of the extension
Use error() instead of runtime_error() everywhere