Add search and file limits

Improves search performance. Partially closes #29.