Singularities in two- and three-dimensional elliptic problems and finite element methods for their treatment