Implemented basic add() algorithm.
Added error checking to db_add().
Added test for db_add().