Analysis and Control of Nonlinear Systems: A Flatness-based Approach