Implementation of getopt and setopt simplified

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>