Almost full port of javascript jade to scala