Added missing getCookie() method to JS
Moved JS configuration object to separate template
Updated templates to match JS changes