Switch isSpent to std::vector<bool> and bit vector.

Use std::vector<bool> for the flag array, and implement proper
serialisation routines for bit vectors.