Cleaned up a lot of the listener code and added manifest entries.