Performance fixes + some missing semicolons added

- cache regexp in `expand`
- `has` without additional function call and object creating each time
- remove some unused local variables
- a bit better compression with uglifyjs