Initial commit of ported code.