First round of commits. Preliminary base code