Exported set_reference_stateD through the library

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>