Refactoring and dependencies added. Fixes #50 by adding license to all source files as required by GPL v3