Extending Firefox functionality

First of all I am not sure if this is the right place to ask this so please excuse me if it isn’t.
I want to add functionality to the Firefox browser (not add-on) and repack it. This is to create a special browser for a very small group of people. How do I go about doing this? My preferred language is Java but I can also work with C++. Is it going to be enough or do I need to upgrade?

Thanks in advance.