Add counter to users table to track number of times publish_actions has been requested.

References Coursemology/coursemology.org#179.
Track number of times publish_actions has been asked for.

Facebook controller tracks number of times 'Share' button was clicked
when there was no permission to publish.

Popup achievement view stops showing the 'Share' button after permission
has been sought 3 times.

However, this approach is insufficient if the user grants permission on
the 3rd ask as the popup will no longer show the 'Share' button.

References Coursemology/coursemology.org#179.
Move publish_actions permission check to user model.

Permission check moved to user model so it is easier to access from
the achievement popup view. The check function takes the fb_access_token
from the session as a parameter.

Edit the Facebook controller to use that check function.
Reset the permission request counter when it has been used.

Modify achievement popup view to check if permission is already granted.
Only checking if the counter has reached the threshold is insufficient
as the button won't show subsequently if the user only grants permission
on the final request.

References Coursemology/coursemology.org#179.