Refactored some code with more general usefulness into PyscesToolBox (also to prevent circular imports)
Fixed+refined previous commit