APY-13 : Complete the security gateway

Added alternate navigation (still needs testing) and
also added better support for optional and defined
attributes.