Dev/refactor

Use latest Frege, enhancements, fixes