Refactor bnf-loading code, all checks are now together and much better