Refactor main and ensure XBMC has been restarted before going in the menus

Signed-off-by: Steeve Morin <steeve.morin@gmail.com>