AVM1 LoadVars

Plus some cleanup and bugfixes for things found on the way.