Several fixes and added 'add function' entry in 'library_item'.

Library items are now able to contain functions (class methods), which
will be added to the generated output.