Scott Loach has completed a move to newly-promoted Championship side Rotherham United after being released by Ipswich Town.