Rewrote matching routines to be more efficient (ver. 1.11)

Signed-off-by: nixnodes <code@eth.si>
Latest: 1.11

Signed-off-by: nixnodes <code@eth.si>