Just a small hint: when you want to insert a block of code here int he forums (or in markdown in general, use triple backticks (```) above and below it to get the proper highlighting.
Regarding the source code, that looks actually all very fine. Where do you place it, how does your folder structure look? Does Kibana start up correctly if you remove the plugin?
Is the full plugin source code somewhere available (on Github)?