Added unit tests. Added support for primitiv types (resolves #6).