Added ability to set a block to be executed upon rotation
Useful if you want to have different configurations for landscape and portrait orientation.