Added tests and started library implementation