[eluser]ray73864[/eluser]
I worked it out to a certain extent. Although this is looking to be more complicated than a widgets library really needs to be.
First you have to create a folder in the 'widgets' directory and make sure it has a 'widget.json' file in it, then you need to do up your views and the main function object for that widget.
Secondly you need to make sure that your layout has an 'area.json' file in it and includes code to load widgets into that area.
Lastly, you need a widgets table in your database, which is all good and everything except the installer doesn't come with the necessary sql code for creating the table.