main_nogui: refactor context initialisation to separate functions
main_nogui: refactor depth generator node creation

Move creation to separate function.