Initial refactor of sam2bp to new SAM API.