Detect node deletion and exit.

* Use OpenCenterEndpoint.whoami()
* Restructure registration.
pep8
Merge pull request #249 from hughsaunders/de106

Merged automatically by jenkins after successful gate test
ensure host_id is an integer
Merge pull request #250 from hughsaunders/de106

Merged automatically by jenkins after successful gate test