Fixes for unsaved files (addresses #2)

Unsaved files will now be properly checked, and the package will
respond appropriately when switching between syntaxes.