lined up indents in save function and fixed boolean checks on PHP side; migrated resetDefaults to angular from jQuery