Major refactor. Use interface-based instead of value-based API for performance reasons. Interfaces moved to 'api' subpackage; implementations moved to 'contrib' subpackage.