Ajax relocation

The ajax and curl were relocated to be within the readURL function.
Also, there are now if statements to run different code for each input
(remote and local) within one function.