Added basic functions and qunit tests