refactor bc.py

 1. remove ambiguous, nested for loops to apply BCs
 2. move generalized subfunctions to fem_mesh module
 3. validated against master (gauss test)