Flesh out API.

also rework extension loader