On the structure and invariants of cubical complexes