Added AJAX call, moved functions to separate files, created a singleton ...

Added AJAX call, moved functions to separate files, created a singleton when creating the HTTP obj.