changes for creating ports and for R16B

Move some of the port creation calls up into Erlang. Modify calls from
Erlang into the driver accordingly. Add portability macros for driver API
functions deprecated in R16B.