Remove core dependencies from CScript

As an ongoing effort to break out script verification. I hope this doesn't conflict with @sipa's or @jtimon's next steps.

This work moves the logic for writing custom core classes to scripts out of CScript. Those classes can describe how their data should be written to a script, and CScript does so without further knowledge.

Please ignore the entire PR's diffstat while reviewing as it won't be at all helpful. Individual commits will make much more sense.

Also, CScriptBinaryData is a pretty terrible name but I couldn't come up with anything better. Suggestions welcome.
I like the idea of having it explicit as in this pull. I don't like the CBinaryData name, maybe simply a function

    << ToVector(xxx) << 

I think Cory is on the right track. I don't like the 'everything with a begin() and end() can apply here' as much. It makes the code hard to follow. And for the serialization code it is important to be easy to follow, as people (also those not very skilled in C++ magic) are reading it.