Add test/ directory and unit test codes & docs