Added nested class demos and minor refactors

Change-Id: Ia9720102eca597e2a73831044d1704f582fbac36