Added logic for hidden networks. Refactored form state functions.
Added hidden network & security options to connect form.