add a refresh properties step to the lifecycle, fix according to jshint, add more tests