Design, Implementation and Testing of a Spark-Ignition Engine Management System