changes APIs and test cases; #4
fixes tab indent; #4
fixes a reference bug; #4
updates test cases; fixes #4