Resolve #30: custom extensions for generic context

This commit implements a way of creating custom extensions for generic
contexts. Please consult the `genericExtTest` test and `genericCustom`
example.