use std::array instead of C arrays
handle port connections from input to output

fixes #13