Cleaned up some code that had to do with HTML generation for actionTrim(). Added some comments and general cleaning