fixing up namespaces, paths, and adding ref to AppDelegate.