C code for scan

Was asked to do a PR with what I have.  The code is incomplete and unusable as-is.

It is missing:
- The type registery and associated support functions
- All output processing
- Modifications to add the CVM and Storage instances in the inputs.
- Probably some other things.