updated model & controller for db efficiency

Updated database connections and cut down on variables passing between
functions. moved a lot of things from the controller to the model to
make all the work done in the model.
secured database access credentials

This may be updated further in the future, but for now the passwords are
no longer stored in the php files used, they are held in an external
file which is protected with htaccess, and the variables are removed
from memory once the database is open
updated JSON output to reflect component availability

Changed the JSON output to work with the "state" of the componenet
(available, unavilable, alternative) instead of by version number.
fixed parsing for nested json

had my array []s in the wrong place
Merge remote-tracking branch 'origin/mvcbranch'

Conflicts:
	cakephp-2.2.7/app/Controller/EclipseController.php