Re-organized writer's api, fixes aes2 decryption bug
Factored out stream structure to its own files