Issue edina/fieldtrip-open/issues/18: Changes for refactoring of createPopup function.