CERES: Keep track of foreground/background status 

The application can now know whether it's in the foreground
or not. This is primarily for notifications vs. dialogs, but 
right now the one place it's implemented can't actually take 
advantage of it (can't call ui thread stuff from application, 
need to find a way to do that)