[SPARK-2531] [SQL] Make BroadcastNestedLoopJoin take into account a BuildSide

JIRA ticket: https://issues.apache.org/jira/browse/SPARK-2531
Actually I think a lot of this is fixed in the codegen PR (i.e. we use projection instead of creating new arrays everytime).  Perhaps we should revisit this PR after that has been merged.