Improve code, create EncryptLib, add tests

I hope its K