Product and product refs json data changes, major frontend js refactoring