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.
Well, this has been through many iterations now. Originally it was polymorphic so that eventual users could add their own serialization functionality. Then that was dropped and serialization was done on a per-type basis. Then that was dropped, and it was templated so that it's all done the same way.

So I suppose this should go one of two ways, rather than the hybrid that it is now

- keep the class, which allows for implicit conversion from anything with begin/end iterators. That would mean that we could drop nearly all of b25d5f0dd531aaf5618f077c646afa556f6277ad, which should've been done when it was templatized.
- Make it a function, and use as in b25d5f0dd531aaf5618f077c646afa556f6277ad.

I really don't care either way. Opinions?