refactor device software
refactor node registration and add Junit test framework