Text this: A weighted residual framework for formulation and analysis of direct transcription methods for optimal control /