fix localstorage helper's keys method
db: sorting matches: be more obvious by considering beginswith and contains matches exclusive
improve templates to use metadata