Cleaned up frontend code. Now frontal uses AppContext.