Added config upgrade stuff to compat.py + cleanup