Implement save, next, prev buttons in add-grammar

Everything appears to work correctly now; the form is ready for the
database backend to be hooked up.