Improved performance by caching files elements

This fix caches the list of trs in an array to avoid having to reselect
them with jQuery.find('tr')