Added PyFlakes source code testing into test suite

Running the test suite will now also check source code using PyFlakes.
Errors will make the test suite fail.
Added GalleryWriter with basic template output.

Some tests had to be changed to adapt for Pelican's API.