Added a call to setupWindow so the import correctly reflects the new DB
state after it finishes.

Also got rid of a lot of named variables in favor of temporaries.