remove grants and use local storage

for compatibility reasons (i.e. firefox) and to be more strict
fix minor bugs