Declaration organization

Organized declarations better. Other misc code cleanup in Worldviewer.