Implemented SyncedPtr and added some helpers for HostPtr. Some code cleanup.