We consider Reed-Solomon (RS) codes whose evaluation points belong to a subfield, and give a linear-algebraic list decoding algorithm that can correct a fraction of errors approaching the code distance, while pinning down the candidate messages to a well-structured affine space of dimension a constant factor smaller than the code dimension. By pre-coding the message polynomials into a subspace-evasive set, we get a Monte Carlo construction of a subcode of Reed-Solomon codes that can be list decoded from a fraction (1-R-ε) of errors in polynomial time (for any fixed ε > 0) with a list size of O(1/ε). Our methods extend to algebraic-geometric (AG) codes, leading to a similar claim over constant-sized alphabets. This matches parameters of recent results based on folded variants of RS and AG codes. but our construction here gives subcodes of <i>Reed-Solomon and AG codes themselves</i> (albeit with restrictions on the evaluation points). Further, the underlying algebraic idea also extends nicely to Gabidulin's construction of rank-metric codes based on linearized polynomials. This gives the <i>first</i> construction of positive rate rank-metric codes list decodable beyond half the distance, and in fact gives codes of rate R list decodable up to the optimal (1-R-ε) fraction of rank errors. A similar claim holds for the closely related subspace codes studied by Koetter and Kschischang. We introduce a new notion called <i>subspace designs</i> as another way to pre-code messages and prune the subspace of candidate solutions. Using these, we also get a <i>deterministic</i> construction of a polynomial time list decodable subcode of RS codes. By using a cascade of several subspace designs, we extend our approach to AG codes, which gives the <i>first deterministic</i> construction of an algebraic code family of rate R with efficient list decoding from 1-R-ε fraction of errors over an <i>alphabet of constant size</i> (that depends only on ε). The list size bound is almost a constant (governed by log* (block length)), and the code can be constructed in quasi-polynomial time.