Hierarchical and singular bases for finite methods