Fixed bug in checking roles and permissions
Update README
Added more tests