Use cc_binary and cc_import to produce shared libraries (#1889) This fixes some compatibility errors for Bazel 0.22.0. Updates #1888