To support running bpp in non-gui mode, the file viewer.cpp needs to be split into a "gui" part and a "lua / data" part.