Removed direct memcache access from runscan.py. Also broke out the main function to enable test later