Serious refactor to consolidate form generation code

Also started using select2 for label filtering