Fixes to various bugs

- So apparently arrays are passed by reference. Don't ask me why I
thought they weren't. A copy of a key array is now passed into the
specific function.

- People like to break my bot by not using the template I provide. To
those people I bend over backwards and refine the regex to suit them.

- Also fixes #4