Reference electrodes based on conducting polymer bilayers