More error catching
minor restructuring. Added tests for SP proxy metadata and IDPs metadata