file structure refactor

roughly as per the end of the discussion in #180 but certainly resolves #180