Merge initial swift work from neillc's fork.

jslint seems to be ok with this code now.