Fix a bug that prevented anonymous roles from propagating up to registered users.

*plpgsql array indexing starts at 1 not 0.
Move the generic read-only logic to come after all read-write lookups.
Use group-* for group permission hits vs gr-* which is also used for generic roles.
Merge pull request #19 from garnertb/geonode_authorize_layer_bugs

Small fixes for geonode_authorize_layer bugs.