work on pages

refactoring
using of cancan for user permissions
removed unused tests 
commented unused gems
link pages to entities of db