Refactor card stuff into its own file, and remove std::map usage