Minor performance improvements

I made some minor performance improvements by caching userAgent, making use of $spoiler instead of $(this), and chaining jQuery methods. (This last one has more to do with personal coding style - no real performance improvements there.)