libubus: refactor code, move request handling to libubus-req.c