Changed json library to Aeson and cleaned up serialization