Making logger more generic. AJAX logger now does the writing to the server