rearrange code into own subfolder to separate it from 3rd-party code; improve readme discussion