Moved format-related code to format package.