I will suggest something for the pins,

In another project I worked, I did a configuration file called pins.h. There you could specify the port and pin of every used pin inside the project. All files included this one to know the pin to use. Here's an example:

    #define EC_ENABLE_PORT              PORTE
    #define EC_ENABLE_DDR                (*(&SOIL_CONTROL_PORT-1))
    #define EC_ENABLE_PORTIN          (*(&SOIL_CONTROL_PORT-2))
    #define EC_ENABLE_PIN                 3

So you just changing EC_ENABLE_PORT and EC_ENABLE_PIN you can reconfigure the desired pin to be other. (this is for compile time configuration). 

For Dynamic pin configuration we can use the pinMode you say.