Refactored arduino communication

Now using concrete classes instead of anonymous classes for JSON
deserialization. It was a neat idea but not very maintainable.