Updated code block UI and unit tests to use CodeCompletionServices

In this PR, I have updated the `CodeBlockEditor` UI class to use the new `CodeCompletionServices` APIs for code completion as well as rewritten unit tests to use `CodeCompletionServices` independent of the UI.

@Benglin PTAL.
The white spaces, namely, new line and carriage return characters are being appended at the end of the string operations in this function.