Added GCM and modularized the code a bit. Should write some tests