Initial commit, needs much testing.