Code cleaned up and DESIGNDOC updated. Buffer cache mostly done