Fix predictable ports bug

Added a method to check ports that are occupied by the gears
Use NodeConfig GEAR_BASE_DIR for gearsDir
Use camel case for local variable names.