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>