Fixed Pylons testing environment and added some tests.