Speed up feeds generation by batching writes

The XML generation underlying our package feeds was doing 1600+ calls to
the write() method on the outfile. For some reason, the Python standard
library insists on calling flush() after every write, which really makes
performance take a nosedive. Wrap the write calls and do them in batches
to remove some of the overhead and make feed generation a bit snappier.

Signed-off-by: Dan McGee <dan@archlinux.org>
Add a 'last_modified' function for mirror status pages

We can use this on both the HTML and JSON views of this data to prevent
recomputation for smart clients that respect the modified date header.

Signed-off-by: Dan McGee <dan@archlinux.org>