Makes all the pointers smart to avoid memory issues Refactors layerSurface code to live inside desktop/layersurface