Implemented basic encapsulation scheme and added unit tests for it.