Chrome 'back' fix, restruct prep for later

Chrome Go Back fixed, restruct code for future enhancements (less in the
main viewer, more in other files that can be used by other layouts),
data types in their own file.