Fixed not saving on compile

Fixes #15
Updated to use new TextBuffer callback API