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 still really don't mind either way. I see the merit in being explicit, and I see the merit in letting CScript handle whatever comes its way.

I see merit in it, and I wouldn't care either way if this was, for example, GUI code. But for consensus-critical code it's too dangerous to just "handle everything that comes its way in *some* way". I like to be explicit and clear in what gets handled how and what the representation is. Remember the fun a while ago with `std::vector<unsigned char>(a.begin,e.end())` with `a` being a std::vector<int>() "just working" by truncating each value?