This collects up utils that are only used in the API code, and moves them from cinder/utils.py to here, for better code organization. Change-Id: Iecd909ef4e24d5597dcccb80a671a27f361e4b4d