Extension support

This PR adds extension support.