Buffer rewritten to use gapbuffer. Broken right now.