cleaned up the integration test code

moved some frequently duplicated code into a function, moved some configuration stuff to a setup function.
added a test for when anonymous accounts are not allowed.