Fixed many syntax errors, AMD works now.  Also included require optimization.