Compile TSG from arbitrary set of weighted fragments

- TSG can be created from CLI with 'discodop grammar tsg'
- TSG can be parsed from CLI with 'discodop parser --bt=...'
- move fragment extraction to doubledop()
- remove code duplication of flatten() and flattenbin()