Update libs, rewrite modules in Scala