#54 Update user code generator to match CPA spec

Note: this change also updates the device code generator function to return a UUID, as per the spec.