File ending and chain fixes

- Added chain parameter to defineParameters
- Connected chains for submission and file endings.
- Added generalized and continuous file ending support for chain forks (inherits from MAIN at point of separation)
- Added missing FILTER= to last IDN. (thx @Mats)
- Moved Phasing modules to correct place in script