Fixed message duplication bug by improving localhost handling
Externalized JSON lib to lib/org.json.jar