Cleaning Up Code

Changed variable names for constancy, removed echoes, added JSON
encoding.