Pages position cache saved into webstorage

+ some refactoring