Initial Testing in the Resources App

This change is part of the work for #14 and adds tests for the resources app and some basic refactoring of the code to fix complaints from flake8.