Proper getopt + head/tail options in decoupe.pl

- Use getopt and a clean sub
- add option to keep the first line in every file (-H)
- add option to keep the last line in every file (-T)

Change-Id: I0f59e528799d18ed722226eab931b8aa31d1cccc