Initial port of repository code.