rewrite localForage as prototype-based api