Added Jackson for JSON, cleaned up code a bit