Peru's government has declared a state of emergency in Lima while deploying soldiers to the streets to help quell a recent surge of violence.