Replace popt with getopt

In a embedded environment you might not want to have to add yet another
library dependency. This commit refactors parse_cmdline() to use
getopt_long() instead och popt.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Signed-off-by: Jonas Johansson <jonasj76@gmail.com>
Merge pull request #40 from jonasj76/replace-popt-with-getopt

Replace popt with getopt