a bit of cleanup and allowing crazy app names by encoding them as URIs when registering handlers