porting changes from gio-sz branch of HACC to genericio
Will require validation before merging into master. Currently, it compiles with Makefile and CMake