moved file/message saving logic to store.py for easier testing
closes #197 - sanitize filename using werkzeug.secure_filename in source.py
fixes from code review for #220