Various fixes and changes

I've done some fixes and changes:
1) Added missing require
2) Added resty.core to speed up code under luajit
3) Removed unused function
4) Modified default permissions that are requested
5) Cookie is now encrypted
6) Fixed several bugs in how URI was stored (this should fix this script for sites that contains iframes and also now it stores arguments, not only URI)
7) Fixed redirection loop in cases where used is not in organisation, but authorized

If you create new repo with lua library itself, I'll try to split the code into oauth library and nginx-dependent part.