Added backbutton support to ModalPopup, massive performance optimization