Reorganize code into module strucutre

...separating types, JSON parsing, and card text parsing.