Huge test base and code additions
Add pattern key behavior