rearrange source tree

Rearrange directory structure based on discussion in #782