Added qeury and q wrapper in bbn plus minor fixes works with some examples now.