Add key/value parsing in main and pass to entry function