Refactor test_generators and pelican_open

- Replace get_populated_generator with setUpClass,  list comprehensions for distill_articles/pages, distill articles only once.
- Refactor pelican_open using contextmanager