several fixes for 1.0 release

- fix regex for split / and ?, 
- add john's changes #35, for Java, to allow relative url and checking the length of config url vs uri
- fix allowedReferers *
- fix to return error url mismatch in json format instead of throwing exception

They are in the same order of the commits