main_nogui: finish re-factoring main loop into functions
main_nogui: finish re-factoring main loop into functions

rjw57/openni-skeleton-export,rjw57/openni-skeleton-export,rjw57/openni-skeleton-export,rjw57/openni-skeleton-export