Re-organize source tree

* Put HAL stuff into it's own library
* Makefile changes to support src/* libraries
* Clean up warnings and unused features