For more information and examples, please read Mozilla's documentation about "Mix-ins", and Justin Fagnani's blog posts: