Updated so app works locally with CORS. Cleaned up the code and comments somewhat.
Added fix for bad encoding