Add support for java.util.Optional

Add support for _java.util.Optional_ for Resources query parameters and return type.
Do not introduce any dependency to java8