Refactoring and updates to crypto classes

Moved and updated crypto package
Updated: Generics usage

Generic usage on reference classes and refactoring