Major changes to implement the scanning service

Has not been run yet.  The service needs to be worked on, and the main
thread callbacks have not been implemented.