Reorganization

Reorganized the folders and added the code for memory allocation.

@dlazell @dvehar @meldckn