add better js error handling around materialize and other AJAX as well a...

...s measure calculation