implemented threading; renamed tilecache.py to main.py