Clean up Utils

Put most util functions in a single class.

When checking for empty text, we'll trim it as well as a last check.
e.g. now "  " will be detected as empty as well.

Stop using hardcoded strings for permissions and features, and use the
SDK constants instead.