Refactored validation

* Checks for invalid characters
* Makes sure parentheses are balanced
* Makes sure parentheses include terms

Added .gitignore file