Cleanup Full Analysis

Removed common defined functions already in analysis.php; also moved
more into analysis.php