SQL formatting with CodeMirror

Not for immediate merge.

I started working on https://sourceforge.net/p/phpmyadmin/feature-requests/1582/ and Codemirror was the first choice since we use it for highlighting and auto completing. 
However, following drawbacks are there
1. Formatting functionality in CodeMirror is not actively developed. I'm using formatting.js from an old version here.
2. Even though the framework for formatting is there we have to define specific rules for SQL. I didn't find anything already developed and the current rules simple format by breaking at ; and brackets.