openpic: move OpenPIC state and related definitions to openpic.h