Addingtests

Authored by Javier Buitrago: Adding unit tests and exceptions to the library.