Improve and clean up scripts to improve performance to run each upgrader step

Clean up the code and improve performance to find all portal types with constraints
Improve code to call checkConsistency through activities if hundred of objects because loading all objects can kill the perfomance

Also, Added test to Folder.recursiveCheckConsistency method