26902 Initial code review

Created a branch from the very first commit to be able to review the whole code written so far.
This does not mean that a merge should be done after the review is done, this is a "dummy" pull request.
Generally speaking, there is a little pre flight tests being performed in this file, is that right ? Wouldn't be better to check things, and issue proper error messages, rather than letting fail later ?