changed the json value for the pin

"port" -> "loc"
created conversion functions for module ports

The two conversion functions are analogous to the conversion functions
previously written for bindings, now binding ports should be easier to
implement