added tests for get and set state in swpriv extension. fixed serialization bugs.