Static and dynamic properties of knotted biopolymers: from bulk to nanochannels and nanopores