At the same functionality as master

A bit more testing and cleaning the code, this will then be merged with master. This will allow new features to be made quicker.