Add <format> class and some generic functions