HPCC-8532 Fix meta annotations and type/scope generation in the IR

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>