moved test/ to inst/test and made improvement

added a main()
added a Makefile