First code commit. Everything appears to be working, but needs more testing and cleanup.