Initial commit.

Not all functions finished yet.