Detangle

This detangles php and html and should be merged into the develop branch for testing before it is merged into the live code base