Base resource modified to handle multiple contexts and views

Fix #171 
base.py now handles the erroneous case where multiple views or contexts might appear on a user session. Base resource now returns the most recently modified context/view and ignores the duplicates. 

Appropriate tests have also been added to resources tests.

Signed-off-by: Sheik Hassan <solergiga@yahoo.com>