refine sparse_set; add unittest code; rewrite Makefile