Extract common functionality to xblock-utils

That conflicts with the default changes though, where default value is not `''`.

Do you think a separate flag might be necessary? Or checking against the default value instead?