A Unified Approach to Input-output Linearization and Concurrent Control of Underactuated Open-chain Multi-body Systems with Holonomic and Nonholonomic Constraints