First commit

May not have all bugs ironed out, but it's mostly working at this point.