WIP
Broke out butterfly_2d to simplify.
Added some useful functions and modules.