Reorganized common elements, configuration

Important configuration keys are now retreived
from os.environ rather than being hardcoded in the
config.py file.