cleans up older code, in particular eliminating lines over 80 chars and moving several functions out of views
changes unused_treatments to check by url rather than name for usage
integrates treatments logic with the resource selection dialogue