SWIFT: a modern highly-parallel gravity and smoothed particle hydrodynamics solver for astrophysical and cosmological applications