Reorganizing the main function, split parsing files into static functions

Each parsing is within it own static function that returns a bool to know
whether it was ok or not.

TODO : fix the json parsing, it fails but works