You've hopefully stumbled upon the methods for creating custom visualizations in Kibana in your research, but you may have noticed that all of those tutorials are for newer versions of Kibana, primarily 4.2 and up.
However, Kibana has been written as a collection of plugins for a long time, so it is possible to write your own and use them in your installation. See https://github.com/elastic/kibana/tree/4.1/src/kibana/plugins
Note, however, that things have changed significantly with regard to plugins, and whatever you write against 4.1 will need a lot of changes to work with the newer "supported" versions. There's also no installation path in 4.1, and if I recall correctly, you'll need to bootstrap your plugin by hand by modifying Kibana's source code.
TL;DR - You can write custom functionality in 4.1, but we don't recommend it, and you probably don't get a lot of help.
Your best bet is upgrading your stack and writing against the official plugin system.
All that said, if you still want to go forward, the contents of the plugins path in 4.1 should be a good starting point.