Refactor

I finished the refactoring.

I've separated out a Popup object.

I attempted separating out the clickOutside binding as we talked about - and also tried the same but as a jQuery plugin. I abandoned that plan, because I found it hard to generalize it in a meaningful way.