Implementing buffer as a gap buffer

Integration not nearly finished & no tests done. Will be travelling the next few days, please improve.