move 'shown' and 'hidden' listeners before modal is created - fix #8