I tried moving functions around and thought I had cyclical function calls, but I guess it was because I was trying to keep `hidePreview()` and `showPreview()` grouped together. Fixed global dependency.

Removed `AppInit` and `DocumentManager`.