Inital commit.

Seems to be working, but minimal testing.