Added a create table checkbox.  I really need to factor this better.
Really bad use of $scope as a kind of global variable.