Test and Code Documentation added

This is a major commit, that should be able to be submitted for the assignment.
The list of changes follow:
- Added (Extensive) Code Documentation;
- Code is now *Robust* for error conditions;
- Code is Tested (the tests folder contains Unit tests for both the functions)
    - the `run_tests.R` script is the script necessary to run the tests.