Add methods to return generic data + refactor cache code.
Merge pull request #238 from unikent/feature/add_generic_data_api

looks good to merge