Making the plugin more plug able

Extending the code with title callback option. I need to alter the title in my project.
Make the plugin plug able without altering the library file.
Code cleanup - Trailing spaces