Fixes in the generator

This commit provides fixes in the generator, making the generated
code compile. It also bring back type() instead of contentType(),
and fixes bugs including undefined symbols, and the Album interface
not working well.

If a type is provided in the API it is automatically recognized and
changed to <object_name>Type.