clean up and comment IR demo apps; add typedefs for cached indexes