Add unit test for builtin mode logic as well as few tidy-up in the code (adding some assertions and API documentation), in particular, to make it clear that builtin-mode is tight to an opened clause, so it must be set to a currently opened clause.