Should code be designed with Security in mind?
I think yes.. but it's not so bad if it is not such at first.
It should be clean and modularized, then security aspects can be added. With redesign if neccessary.
I'll check and share (You should as well before You trust this methodology).