Setup metaboxes on wp_loaded hook to make sure full environment is accessible.