Improving building of IDs to conform to jQuery selectors