added jqXHR as input to popup and modal

Significant changes
can run on jqXHR objects
bunch of other little things
TODO: need to fix appendTo