Add a new post save hook mechanism

postsavehooks are registered by adding a entry in
metadata.postsavehooks in the notebook

Also remove the --script hack.
Add a post_save_hook to save as a script and an extention to activate

The replaces the "--script" functionality. I contains two parts:
* an extension, which activates the UI changes in the notebook, which
  can be used to write the required metadata, both to de-/activate
  the postsavehook and to choose which cells will be written to the
  .py file.
* a notebook_post_save_hook, which saves the notebook as a script