Push down require statements and fix viewer

Pushed down require statments to the code that actually requires the
dependency.  Also fixed github dependency in viewer.