Refactor, decouple core from framework and add Laravel implementation