First impl version plus tests

Change-Id: I8960ad08f69c424db9adb104916e77a1f4117b7e