Initial code

An import of the code from the closed source project.