schema based object encoding/decoding using varstruct that supports strings, booleans etc