Added testall.sh and test cases, updated makefile.

Makefile can delete all intermediate files now.
Added several test cases for both basic functions and math functions.