Merge initial swift work from neillc's fork.

Don't create the var if you don't need it. The return value from $modal.open may be ignored if you don't need to use it.