Autocomplete finally working fine. Cache removed - it is terrifying. Mainjs code not so dry as it should be.