Move out brepl stuff and fix for :advanced optimizations

So brepl will only be compiled for 'dev' build