layers now have UID's (sort of).  It should at least make the code for selecting/adding/deleting/renaming them simpler.