fix schema and add second permission hook
 big clean up of schema to match better the templates
Merge pull request #5 from tlhomme/dev

Dev