Interference-Aware Downlink and Uplink Resource Allocation in HetNets with D2D Support