Added option to select algorithm

- Added more tests
- Refactored digest creation
Created class to handle File opening and closing
Refactored file handling