added crai building methods that takes input stream
Merge remote-tracking branch 'upstream/cram_code_base' into cram-rebased