removed isUrl function
cleaned up the JS a bit and replaced stale references to 'groups' with 'entities'