added tabs and linked it with pages

tabs now listen page changes and pages now listen tab changes.