Simplify/fix parsing of 'type' in REST API search

- `strpos()` expects a string and throws a warning when given
  an array.
- For consistency with the other fields, assume $_GET['type'] isn't
  an array already, and split by ' '.
Merge pull request #149 from scriptotek/types

Simplify/fix parsing of 'type' in REST API search