Some small improvements, generalizing TestContextListenerRegistrator