"test.py" rewritten under nosetests framework

This will be the official branch for future testing. 

Finished rewriting the original "test.py" using nosetests framework and numpy testing tool.