Feature/unittesting

Added some testing, and full comments for all functions and classes.