GetOpt module rewritten. Jasmine tests added